package cn.zjq.unilityclass.kehouzuoye.four;

import java.util.ArrayList;
import java.util.List;

public class Lottery {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        getredBall(list);
        getblueBall(list);
        System.out.println("双色球预测号：");
        for (int i = 0;i<list.size()-1;i++) {
            int a = list.get(i);
            System.out.print(a+" ");
        }

        System.out.print("+ "+list.get(6));
        System.out.println("\n"+"预祝你早日中大奖！！");
    }
    //(int)(Math.random()*(最大值-最小值+1)+最小值）；

    public static void getredBall(List<Integer> list){
        for (int i = 0; i < 6; i++) {
            int redBall = 1+(int)(Math.random()*33);
            while(list.contains(redBall)){
                 redBall = 1+(int)(Math.random()*33);

            }
            list.add(redBall);
            //Collections.sort(list);
        }
    }
    public static void getblueBall(List<Integer> list){
        int blueBall = 1+(int)(Math.random()*16);
        list.add(blueBall);
    }
}
